package com.data.monitoring.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 监控文件夹配置
 * </p>
 *
 * @author HanYiMing
 * @since 2025-05-28
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("monitored_folders")
@ApiModel(value = "MonitoredFolders对象", description = "监控文件夹配置")
public class MonitoredFolders extends Model<MonitoredFolders> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "folder_id", type = IdType.AUTO)
    private Integer folderId;

    @ApiModelProperty("所属服务器ID")
    @TableField("server_id")
    private Integer serverId;

    @ApiModelProperty("文件夹绝对路径")
    @TableField("folder_path")
    private String folderPath;

    @ApiModelProperty("显示别名")
    @TableField("alias")
    private String alias;

    @ApiModelProperty("检查间隔(秒)")
    @TableField("check_interval")
    private Integer checkInterval;

    @ApiModelProperty("监控深度(子文件夹层级)")
    @TableField("max_depth")
    private Integer maxDepth;

    @ApiModelProperty("是否启用监控")
    @TableField("is_active")
    private Boolean active;

    @TableField("created_at")
    private LocalDateTime createdAt;

    @TableField("updated_at")
    private LocalDateTime updatedAt;

    @TableField(exist = false)
    private Servers servers;

    @Override
    public Serializable pkVal() {
        return this.folderId;
    }
}
